/**@Title   MailController.java
 * @Package controller
 * @Desc    
 * @Author  GongWenhua
 * @Date    2017年7月3日 上午10:27:58
 * @Version 1.0
*/
package com.gong.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gong.service.MailService;

@Controller
public class MailController {
	
	@Autowired
	private MailService mailservice;
	
	private String to = "1042566734@qq.com";
	
	@RequestMapping("/mail")
	public String mail(){
		return "/mail";
	}
	
	@RequestMapping("/send")
	@ResponseBody
	public String sendMail(String title,String content){
		System.out.println("mail title:"+title+" "+content);
		mailservice.sendSimple(to, title, content);
		return "success";
	}
}
